package com.tdd;

public class OperationFactory {
	public Operation findOperationNamed(String operatorName) {
		Operation op = null;
		
		if ("-".equals(operatorName))
			op = new Minus();
		else if ("!".equals(operatorName))
			op = new Factorial();
		else if ("+".equals(operatorName))
			op = new Plus();
		else
			throw new RuntimeException(String.format("%s - unknown operator",
					operatorName));
		return op;
	}
}
